home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 119_01.zip / DWSMITH.MSS < prev    next >
Text File  |  1993-06-16  |  2KB  |  47 lines

  1. @heading(MINCE Extensions
  2. by Dave W. Smith)
  3. @@Begin(Verbatim)
  4. @address(August 7, 1981)
  5. Enclosed is a listing of some additional commands derived from EMACS &
  6. co.  The commands to toggle the case of a character, and to write the
  7. file and exit are straightforward, and should require no additional
  8. discussion. However, the command to find matching delimiters may need
  9. a bit of explanation.
  10.  
  11. First note that the delimiter to match is extracted from the command
  12. by masking off the meta and Control-X bits. This means that you can
  13. add the command as either C-X-<delim> or M-<delim> with the same
  14. effect. I chose the M-<delim> form because I was used to it from
  15. another editor.
  16.  
  17. The second point, which may interest those who attempt to use 'MoveTo'
  18. and 'MovePast' from Support.C, is that I rolled my own search code
  19. after choosing not to use 'MoveTo'. One obvious approach to searching
  20. for a delimiteris to use 'MoveTo', passing it a predicate function
  21. that keeps track of matching delimiters on the side, such that the
  22. predicate returns true only when it sees the delimiter that really
  23. matches. This works in most cases, and is a fairly elegant solution.
  24. However, 'MoveTo' checks first to see if you've moved backward to the
  25. start of the buffer, and returns WITHOUT CALLING THE PREDICATE if you
  26. have. Thus if you're searching  for a matching delimiter that happens
  27. to be the first character in the buffer, the search will fail! This
  28. isn't a problem if you're searching forward in the file.
  29.  
  30. @@Moral ( Beware of tricky predicates! )
  31.  
  32. I would be interested in hearing from anyone who has successfully
  33. added an equivalent to the EMACS M-! command (move line to top of
  34. page) @foot(I looked in my EMACS Manual, corresponding to EMACS
  35. version 150, and can't  find M-! or a ^R command that seems to
  36. correspond. -Barry). If you've managed to do it, PLEASE submit the code
  37. to AUG. I've tried a couple of times, but I can't seem to make it work
  38. in all cases.
  39. @display(-Enjoy
  40.  
  41. Dave W. Smith 
  42. 450 N. Mathilda, #O-103
  43. Sunnyvale, CA. 94086)
  44.  
  45.  
  46. eturns true only when it sees the delimiter that really
  47. matches. This works in most cases, and is a fair